//
//  NewMonthBaogaoInfoViewControllerViewController.m
//  wangzhe
//
//  Created by 李 佳伟 on 2018/3/16.
//  Copyright © 2018年 李 佳伟. All rights reserved.
//

#import "NewMonthBaogaoInfoViewControllerViewController.h"
#import "JTCSM.h"
#import "XXPageChildViewController.h"
@interface NewMonthBaogaoInfoViewControllerViewController ()
{
    NSArray *pageTitles;
}
@end

@implementation NewMonthBaogaoInfoViewControllerViewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        
        UILabel *label = [UILabel initWithFrame:CGRectMake(0, 0, 60, 40) text:@"详情" font:22 textAlignment:NSTextAlignmentCenter texcolor:[UIColor blackColor] backgroundColor:[UIColor clearColor]];
        [self.navigationItem setTitleView:label];
    }
    return self;
}
- (void)viewWillAppear:(BOOL)animated{
    [super viewWillAppear:YES];
    [df isRemoveTarbar:YES];
    [JTCSMSingle shareSingle].thevc = self;
    
    leftBarButtonItems_rightBarButtonItems *leftbtn = KCUSTOMNAVIGSTION_ALLOC;
    self.navigationItem.leftBarButtonItem = [leftbtn setBarButtonItemsImageName:@"fanhui.png" frame:KLeftBarButtonItemFrame_image target:self SEL:@selector(gotoback)];
}
- (void)gotoback{
    [self.navigationController popViewControllerAnimated:YES];
}
- (void)viewDidLoad {
    [super viewDidLoad];
    self.navigationController.navigationBar.hidden = NO;
    self.edgesForExtendedLayout = UIRectEdgeNone;
    [self.navigationController.navigationBar setBackgroundImage:[UIImage imageNamed:@"navBar.png"] forBarMetrics:UIBarMetricsDefault];
    
    self.view.backgroundColor = [UIColor whiteColor];
    NSArray *array = @[@"",@"",@"",@"",@""];
    [self layoutTitleWithArray:@[@"全部",@"微信",@"支付宝",@"银联云闪付",@"快捷支付"] indexArray:@[@"1",@"2",@"3",@"4",@"5"] dictArray:array];
    // Do any additional setup after loading the view.
}

- (void)layoutTitleWithArray:(NSArray *)array indexArray:(NSArray *)indexArray dictArray:(NSArray *)dic{
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    pageTitles = array;
    
    NSUInteger _pageNumber = pageTitles.count;
    [self setBlock_numberOfPages:^(void){
        return _pageNumber;
    }];
    
    __weak NSArray *weak_array = pageTitles;
    [self setBlock_titleForPageAtIndex:^(NSUInteger index){
        NSArray *strong_array = weak_array;
        return [strong_array objectAtIndex:index];
    }];
    
    [self setBlock_viewControllerAtIndex:^(NSUInteger index){
        return [XXPageChildViewController CreateViewControllerWithAlias:indexArray[index] dict:dic[index] isWXJL:@"qr"];
    }];
    
    [self reloadData];
}
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex{
    if(alertView.tag == KAlertVTag+1){
        [df gotoLoginVC:self.navigationController];
        
    }
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


/*
 #pragma mark - Navigation
 
 // In a storyboard-based application, you will often want to do a little preparation before navigation
 - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
 // Get the new view controller using [segue destinationViewController].
 // Pass the selected object to the new view controller.
 }
 */

@end
